package com.sky.mapper;

import com.sky.annotion.AutoFill;
import com.sky.entity.User;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
    @Select("select * from sky_take_out.user where openid = #{openId}")
    User selectUserByOpenId(String openId);

    @Select("select * from sky_take_out.user where id = #{id}")
    User getUserById(Long id);
    @AutoFill(value = OperationType.INSERT)
    void insertUser(User user);

    Long getUserByCreateTime(Map map);

    Integer countByMap(Map map);
}
